import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NewsdetailComponent } from './components/newsdetail/newsdetail.component';
import { NewslistComponent } from './components/newslist/newslist.component';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {NgHttpLoaderModule} from 'ng-http-loader';
import { ToastComponent } from './components/toast/toast.component';
import {PipesModule} from './pipes/pipes.module';
import { CarouselComponent } from './components/carousel/carousel.component';
import { Mp3playComponent } from './components/mp3play/mp3play.component';
import { VideoplayComponent } from './components/videoplay/videoplay.component';
import { IndexComponent } from './components/index/index.component';
import { SinglepageComponent } from './components/singlepage/singlepage.component';
import { FootComponent } from './components/foot/foot.component';
import { P401Component } from './components/p401/p401.component';
import { P403Component } from './components/p403/p403.component';
import { LoginComponent } from './components/login/login.component';
import { IonicStorageModule } from '@ionic/storage';
import {FormsModule} from '@angular/forms';
import {MyHttpInterceptor} from './services/MyHttpInterceptor';
import { RegistComponent } from './components/regist/regist.component';
import { UserinfoComponent } from './components/userinfo/userinfo.component';
import { SetheadComponent } from './components/sethead/sethead.component';
import { SetpassComponent } from './components/setpass/setpass.component';

@NgModule({
  declarations: [
    AppComponent,
    NewsdetailComponent,
    NewslistComponent,
    ToastComponent,
    CarouselComponent,
    Mp3playComponent,
    VideoplayComponent,
    IndexComponent,
    SinglepageComponent,
    FootComponent,
    P401Component,
    P403Component,
    LoginComponent,
    RegistComponent,
    UserinfoComponent,
    SetheadComponent,
    SetpassComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    HttpClientModule,
    NgbModule,
    NgHttpLoaderModule.forRoot(),
    PipesModule,
    IonicStorageModule.forRoot({
      name: 'cms',
      driverOrder: ['localstorage']
    }),
    FormsModule
  ],

  entryComponents:[
  LoginComponent,
    SetheadComponent,
    SetpassComponent
  ],

  providers: [ {
    provide: HTTP_INTERCEPTORS,
    useClass: MyHttpInterceptor,
    multi: true //每次HTTP请求时执行
  }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
